# include<cstdio>
# include<cstring>
# include<algorithm>
# include<iostream>
# define M 1000000
using namespace std;
int c[M+10];
void sol(){
    __int64 t,i;
    memset(c,0,sizeof(c));
    c[1]=1;
    for(i=2;i<M;i++){
        t=i;
        if(t!=1)
        c[i]++;
        while(t!=1){
            t=t&1?3*t+1:t/2;
            if(i>t){
                c[i]+=c[t];
                break;
            }
            c[i]++;

        }
    }
}

int solve(int x,int y){
    int i;
    int max1=c[x];
    for(i=x;i<=y;i++)
    max1=max(max1,c[i]);
    return max1;
}

int main(){
    int x,y,s;
    sol();
    while(EOF!=scanf("%d%d",&x,&y)){
        printf("%d %d ",x,y);
        if(x>y)swap(x,y); //此处用到了c++中的
        s=solve(x,y);
        cout<<s<<endl;
    }
    return 0;
}
